import { Route,Redirect } from "react-router-dom"
import session from "../utils/storage/session"
export default ({component,...rest})=>{
    let token=session.get("token")
    if(token){
        return <Route component={component} {...rest} />
    }else{
        return <Redirect to={"/login"}/>
    }
    
}